﻿#pragma once

#include "../Enums.h"
#include "ItemData.h"
#include "Stat.h"
#include "../Functions/IniReader.h"
#include <string>
#include <vector>
#include <any>
#include "../../stringhelper.h"

//C# TO C++ CONVERTER NOTE: Forward class declarations:
class GuildMember;

class GuildRank
{
public:
    std::vector<GuildMember*> Members = std::vector<GuildMember*>();
    std::string Name = "";
    int Index = 0;
    GuildRankOptions Options = static_cast<GuildRankOptions>(0);
    GuildRank();

    GuildRank(BinaryReader *reader, bool Offline = false);
    void Save(BinaryWriter *writer, bool Save = false);
};

class GuildStorageItem
{
public:
    UserItem *Item;
    long long UserId = 0;
    virtual ~GuildStorageItem()
    {
        delete Item;
    }

    GuildStorageItem();

    GuildStorageItem(BinaryReader *reader);
    void Save(BinaryWriter *writer);
};

class GuildMember
{
public:
    std::string name = "";
    int Id = 0;
    std::any Player;
    DateTime LastLogin;
    bool hasvoted = false;
    bool Online = false;

    GuildMember();

    GuildMember(BinaryReader *reader, bool offline = false);
    void Save(BinaryWriter *writer);
};

class GuildBuffInfo
{
public:
    int Id = 0;
    int Icon = 0;
    std::string name = "";
    unsigned char LevelRequirement = 0;
    unsigned char PointsRequirement = 1;
    int TimeLimit = 0;
    int ActivationCost = 0;

    Stats *Stats;

    virtual ~GuildBuffInfo()
    {
        delete Stats;
    }

    GuildBuffInfo();

    GuildBuffInfo(BinaryReader *reader);

    GuildBuffInfo(InIReader *reader, int i);

    void Save(InIReader *reader, int i);

    void Save(BinaryWriter *writer);

    std::string ToString();

    std::string ShowStats();
};

class GuildBuff
{
public:
    int Id = 0;
    GuildBuffInfo *Info;
    bool Active = false;
    int ActiveTimeRemaining = 0;

    virtual ~GuildBuff()
    {
        delete Info;
    }

    bool getUsingGuildSkillIcon() const;

    GuildBuff();

    GuildBuff(BinaryReader *reader);
    void Save(BinaryWriter *writer);
};

//outdated but cant delete it or old db's wont load
class GuildBuffOld
{
public:
    GuildBuffOld();

    GuildBuffOld(BinaryReader *reader);
};
